package com.heima.controller;


import com.heima.service.IDepartmentService;
import com.heima.vo.CommonResult;
import com.heima.vo.DepartmentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 科室 前端控制器
 * </p>
 *
 * @author wangjiexin
 * @since 2023-01-29
 */
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    IDepartmentService iDepartmentService;

    @GetMapping("/list")
    public CommonResult getList(@RequestParam(defaultValue = "1") Integer page,
                                @RequestParam(defaultValue = "10") Integer pageSize){
        List<DepartmentVO> list = iDepartmentService.selectList(page, pageSize);

        return CommonResult.success(list);
    }


}

